package cn.agiledata.bank.common.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import cn.agiledata.bank.common.util.Constant;
import cn.agiledata.bank.hibernateBean.Account;
import cn.agiledata.bank.myspace.service.IMySpaceService;
import com.vnv.infrastructure.action.IPBBaseAction;
import com.vnv.infrastructure.exception.IPBException;
import com.vnv.infrastructure.logic.IPBAppFactory;

public class AccountAction extends IPBBaseAction implements Constant {
	protected IMySpaceService getMySpaceService() throws IPBException {
		return (IMySpaceService) IPBAppFactory.getObj(IMySpaceService.MGR_ID);
	}
	/**
	 * 得到账户
	 * @param request
	 * @return
	 */
	public ActionForward getAccount(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response)throws IPBException, Exception{
		String accountId = request.getParameter("accountId");
		Account account = getMySpaceService().getAccount(accountId);
		request.setAttribute("account",account);
		return mapping.findForward(SUCCESS);
	}	
}
